package com.ckg.service;

import com.ckg.dao.BookDao;

// 3. 服务类
public class BookService {
    private BookDao bookDao;

    // 通过setter注入依赖
    public void setBookDao(BookDao bookDao) {
        this.bookDao = bookDao;
    }

    //构造器注入
    public BookService(BookDao bookDao) {
        this.bookDao = bookDao;
    }

    public void saveBook() {
        System.out.println("开始保存图书信息...");
        bookDao.save();
    }
}
